package thread;

import java.util.Scanner;

public class Demo1 {

	public static void main(String[] args) {
		Thread1 t1=new Thread1();
		Thread2 t2=new Thread2();
		t1.start();
		t2.start();
		try {
			Thread.sleep(1000);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	/*	while(true){
			System.out.println("t1 state:"+t1.getState());
			System.out.println("t2 state:"+t2.getState());*/
			System.out.println("main state:"+Thread.currentThread().getName());
			
		}

	}


class Thread1 extends Thread{
	public void run(){
		int i=0;
			if(i==50){
				Scanner in=new Scanner(System.in);
				System.out.println("请输入：");
				int a=in.nextInt();
				System.out.println("a="+a);
			}
		}
	}
class Thread2 extends Thread{
	@Override
	public void run() {
		// TODO Auto-generated method stub
		while(true){
			
		}
	}
}